import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ZhengZe {
    public static void main(String[] args) {
        String str="abc123abc123";
        String rule=".*123.*";
//        Pattern pattern= Pattern.compile(rule);
//        Matcher matcher=pattern.matcher(str);
//        while(matcher.find()){
//            System.out.println(matcher.group());
//        }
        boolean is=Pattern.matches(rule,str);

        System.out.println(is);


    }
}
